package com.lxd.milktea.service;

import com.lxd.milktea.dataobject.Material;
import com.lxd.milktea.form.MaterialRe;
import com.lxd.milktea.form.MaterialReForm;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ProjectName: milktea
 * @Package: com.lxd.milktea.service
 * @ClassName: MaterialService
 * @Author: carrymaniac
 * @Description:
 * @Date: 2020/5/3 2:03 下午
 * @Version:
 */
public interface MaterialService {
    /**
     * 通过ID查询原料信息
     * @param materialId
     * @return
     */
    Material findOne(String materialId);

    /**
     * 解析该原料的原始材料组成
     * @param materialId
     * @return
     */
    HashMap<String,Integer> findOneForm(String materialId);

    Map<String, Integer> findOneSon(String materialId);
    /**
     * 新增或更新
     * @param material
     * @return
     */
    Material save(Material material);

    /**
     * 批量查询
     * @param ids
     * @return
     */
    List<Material> findList(List<String> ids);

    /**
     * 分页查询
     * @param pageable
     * @return
     */
    Page<Material> findList(Pageable pageable);

    /**
     * 查询全部
     * @return
     */
    List<Material> findAll();


    void deleteMaterialRe(String materialId);

    List<com.lxd.milktea.dataobject.MaterialRe> saveMaterialRe(String material, List<MaterialRe> materialRes);


}
